
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>大话数据结构笔记2 · My Study Note</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="yanglonglong">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-toggle-chapters/toggle.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-flexible-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-theme-comscore/test.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../面试笔试/" />
    
    
    <link rel="prev" href="大话数据结构笔记1.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="https://www.yangllong.top/" target="_blank" class="custom-link">My Blog</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../Linux相关/">
            
                <a href="../Linux相关/">
            
                    
                    Linux相关
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../Linux相关/make工具的使用.html">
            
                <a href="../Linux相关/make工具的使用.html">
            
                    
                    Make工具的使用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../springboot/">
            
                <a href="../springboot/">
            
                    
                    Springboot
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../springboot/springboot一些遇到的问题.html">
            
                <a href="../springboot/springboot一些遇到的问题.html">
            
                    
                    Springboot一些遇到的问题
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../vue/">
            
                <a href="../vue/">
            
                    
                    Vue
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../vue/vue+ssm跨域问题.html">
            
                <a href="../vue/vue+ssm跨域问题.html">
            
                    
                    Vue+Ssm跨域问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../vue/vue-cli3.html">
            
                <a href="../vue/vue-cli3.html">
            
                    
                    Vue Cli3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../vue/安装vue.html">
            
                <a href="../vue/安装vue.html">
            
                    
                    安装Vue
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../其他/">
            
                <a href="../其他/">
            
                    
                    其他
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../其他/分布式系统.html">
            
                <a href="../其他/分布式系统.html">
            
                    
                    分布式系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../其他/图解http.html">
            
                <a href="../其他/图解http.html">
            
                    
                    图解Http
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../其他/消息队列.html">
            
                <a href="../其他/消息队列.html">
            
                    
                    消息队列
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../其他/爬虫.html">
            
                <a href="../其他/爬虫.html">
            
                    
                    爬虫
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../刷题/">
            
                <a href="../刷题/">
            
                    
                    刷题
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../刷题/NOJ.html">
            
                <a href="../刷题/NOJ.html">
            
                    
                    NOJ
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../刷题/leetcode/">
            
                <a href="../刷题/leetcode/">
            
                    
                    Leetcode
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../刷题/leetcode/107简单题.html">
            
                <a href="../刷题/leetcode/107简单题.html">
            
                    
                    107简单题
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.3.1" data-path="../刷题/leetcode/2两数相加.html">
            
                <a href="../刷题/leetcode/2两数相加.html">
            
                    
                    2两数相加
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3.2" data-path="../刷题/leetcode/3无重复子串的最大长度.html">
            
                <a href="../刷题/leetcode/3无重复子串的最大长度.html">
            
                    
                    3无重复子串的最大长度
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../刷题/扇贝杯csdn.html">
            
                <a href="../刷题/扇贝杯csdn.html">
            
                    
                    扇贝杯Csdn
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../刷题/排序算法.html">
            
                <a href="../刷题/排序算法.html">
            
                    
                    排序算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../刷题/蓝桥杯.html">
            
                <a href="../刷题/蓝桥杯.html">
            
                    
                    蓝桥杯
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../刷题/蓝桥杯热身赛.html">
            
                <a href="../刷题/蓝桥杯热身赛.html">
            
                    
                    蓝桥杯热身赛
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="../刷题/计算机等级考试(C语言">
            
                <span>
            
                    
                    计算机等级考试(C语言)
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../博客/">
            
                <a href="../博客/">
            
                    
                    博客
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../博客/next主题配置.html">
            
                <a href="../博客/next主题配置.html">
            
                    
                    Next主题配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../博客/一些问题的记录.html">
            
                <a href="../博客/一些问题的记录.html">
            
                    
                    一些问题的记录
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../学习java/">
            
                <a href="../学习java/">
            
                    
                    学习Java
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../学习java/AQS.html">
            
                <a href="../学习java/AQS.html">
            
                    
                    AQS
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../学习java/HashMap的简单实现.html">
            
                <a href="../学习java/HashMap的简单实现.html">
            
                    
                    HashMap的简单实现
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../学习java/JavaByteCode.html">
            
                <a href="../学习java/JavaByteCode.html">
            
                    
                    JavaByteCode
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../学习java/Java基础.html">
            
                <a href="../学习java/Java基础.html">
            
                    
                    Java基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.5" data-path="../学习java/Java多线程.html">
            
                <a href="../学习java/Java多线程.html">
            
                    
                    Java多线程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.6" data-path="../学习java/Java多线程并发.html">
            
                <a href="../学习java/Java多线程并发.html">
            
                    
                    Java多线程并发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.7" data-path="../学习java/Java爬虫.html">
            
                <a href="../学习java/Java爬虫.html">
            
                    
                    Java爬虫
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.8" data-path="../学习java/Java集合.html">
            
                <a href="../学习java/Java集合.html">
            
                    
                    Java集合
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.9" data-path="../学习java/java常用类.html">
            
                <a href="../学习java/java常用类.html">
            
                    
                    Java常用类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.10" data-path="../学习java/jvm.html">
            
                <a href="../学习java/jvm.html">
            
                    
                    Jvm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.11" data-path="../学习java/noifelse.html">
            
                <a href="../学习java/noifelse.html">
            
                    
                    Noifelse
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.12" data-path="../学习java/socket.html">
            
                <a href="../学习java/socket.html">
            
                    
                    Socket
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.13" data-path="../学习java/一些Java方法.html">
            
                <a href="../学习java/一些Java方法.html">
            
                    
                    一些Java方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.14" data-path="../学习java/一些其他人写的博客.html">
            
                <a href="../学习java/一些其他人写的博客.html">
            
                    
                    一些其他人写的博客
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.15" data-path="../学习java/硬核空间.html">
            
                <a href="../学习java/硬核空间.html">
            
                    
                    硬核空间
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.16" data-path="../学习java/遇到的问题.html">
            
                <a href="../学习java/遇到的问题.html">
            
                    
                    遇到的问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.17" data-path="../学习java/阻塞队列.html">
            
                <a href="../学习java/阻塞队列.html">
            
                    
                    阻塞队列
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../安卓开发/">
            
                <a href="../安卓开发/">
            
                    
                    安卓开发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../安卓开发/First App.html">
            
                <a href="../安卓开发/First App.html">
            
                    
                    First App
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../安卓开发/problems.html">
            
                <a href="../安卓开发/problems.html">
            
                    
                    Problems
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../工具/">
            
                <a href="../工具/">
            
                    
                    工具
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../工具/IDEA.html">
            
                <a href="../工具/IDEA.html">
            
                    
                    IDEA
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../工具/docker.html">
            
                <a href="../工具/docker.html">
            
                    
                    Docker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="../工具/github.html">
            
                <a href="../工具/github.html">
            
                    
                    Github
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../数据库/">
            
                <a href="../数据库/">
            
                    
                    数据库
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../数据库/MVCC.html">
            
                <a href="../数据库/MVCC.html">
            
                    
                    MVCC
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="../数据库/MySQL.html">
            
                <a href="../数据库/MySQL.html">
            
                    
                    MySQL
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.3" data-path="../数据库/Redis.html">
            
                <a href="../数据库/Redis.html">
            
                    
                    Redis
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="./">
            
                <a href="./">
            
                    
                    数据结构知识
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.12.1" data-path="大话数据结构笔记1.html">
            
                <a href="大话数据结构笔记1.html">
            
                    
                    大话数据结构笔记1
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.12.2" data-path="大话数据结构笔记2.html">
            
                <a href="大话数据结构笔记2.html">
            
                    
                    大话数据结构笔记2
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../面试笔试/">
            
                <a href="../面试笔试/">
            
                    
                    面试笔试
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1" data-path="../面试笔试/字节跳动5月11日笔试.html">
            
                <a href="../面试笔试/字节跳动5月11日笔试.html">
            
                    
                    字节跳动5月11日笔试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.2" data-path="../面试笔试/阿里3月23日笔试.html">
            
                <a href="../面试笔试/阿里3月23日笔试.html">
            
                    
                    阿里3月23日笔试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.3" data-path="../面试笔试/面试突击.html">
            
                <a href="../面试笔试/面试突击.html">
            
                    
                    面试突击
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >大话数据结构笔记2</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x5927;&#x8BDD;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x7B14;&#x8BB0;&#xFF08;&#x4E8C;&#xFF09;">&#x5927;&#x8BDD;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x7B14;&#x8BB0;&#xFF08;&#x4E8C;&#xFF09;</h1>
<h3 id="&#x6570;&#x636E;&#x7ED3;&#x6784;&#x4E0E;&#x7B97;&#x6CD5;&#x7684;&#x5173;&#x7CFB;">&#x6570;&#x636E;&#x7ED3;&#x6784;&#x4E0E;&#x7B97;&#x6CD5;&#x7684;&#x5173;&#x7CFB;</h3>
<blockquote>
<p>&#x5C31;&#x50CF;&#x6881;&#x5C71;&#x4F2F;&#x4E0E;&#x795D;&#x82F1;&#x53F0;&#xFF0C;&#x7F57;&#x5BC6;&#x6B27;&#x4E0E;&#x6731;&#x4E3D;&#x53F6;&#x3002;&#x4E0D;&#x53EF;&#x53EA;&#x8C08;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x4E0D;&#x8C08;&#x7B97;&#x6CD5;&#x3002;</p>
</blockquote>
<h3 id="&#x4E24;&#x79CD;&#x7B97;&#x6CD5;&#x7684;&#x6BD4;&#x8F83;">&#x4E24;&#x79CD;&#x7B97;&#x6CD5;&#x7684;&#x6BD4;&#x8F83;</h3>
<blockquote>
<p>&#x6C42;1+2+3+ ... +100</p>
</blockquote>
<pre><code class="lang-c"><span class="hljs-keyword">int</span> i, sum = <span class="hljs-number">0</span>, n = <span class="hljs-number">100</span>;
<span class="hljs-keyword">for</span>( i = <span class="hljs-number">1</span>; i &lt;= n; i++)
{
    sum = sum +i;
}
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot; %d &quot;</span>, sum);
</code></pre>
<p>&#x9700;&#x8981;&#x5FAA;&#x73AF;100&#x6B21;:sweat:</p>
<pre><code class="lang-c"><span class="hljs-comment">//&#x9AD8;&#x65AF;&#x7684;&#x65B9;&#x6CD5;</span>
<span class="hljs-keyword">int</span> i, sum = <span class="hljs-number">0</span>, n = <span class="hljs-number">100</span>;
sum = (<span class="hljs-number">1</span> + n)*n/<span class="hljs-number">2</span>;
<span class="hljs-built_in">printf</span>(<span class="hljs-string">&quot;%d&quot;</span>,sum);
</code></pre>
<p>&#x6C42;&#x7B49;&#x5DEE;&#x6570;&#x5217;&#x7684;&#x7B97;&#x6CD5;&#xFF0C;&#x4E0D;&#x9700;&#x8981;&#x5FAA;&#x73AF;:+1:</p>
<h3 id="&#x7B97;&#x6CD5;&#x5B9A;&#x4E49;">&#x7B97;&#x6CD5;&#x5B9A;&#x4E49;</h3>
<blockquote>
<p>&#x7B97;&#x6CD5;&#x662F;&#x89E3;&#x51B3;&#x7279;&#x5B9A;&#x95EE;&#x9898;&#x6C42;&#x89E3;&#x6B65;&#x9AA4;&#x7684;&#x63CF;&#x8FF0;&#xFF0C;&#x5728;&#x8BA1;&#x7B97;&#x673A;&#x4E2D;&#x8868;&#x73B0;&#x4E3A;&#x6307;&#x4EE4;&#x7684;&#x6709;&#x9650;&#x5E8F;&#x5217;&#xFF0C;&#x5E76;&#x4E14;&#x6BCF;&#x6761;&#x6307;&#x4EE4;&#x8868;&#x793A;&#x4E00;&#x4E2A;&#x6216;&#x591A;&#x4E2A;&#x64CD;&#x4F5C;</p>
</blockquote>
<h3 id="&#x7B97;&#x6CD5;&#x7279;&#x6027;">&#x7B97;&#x6CD5;&#x7279;&#x6027;</h3>
<ul>
<li>&#x8F93;&#x5165;&#xFF1A;&#x6709;&#x96F6;&#x4E2A;&#x6216;&#x591A;&#x4E2A;&#x8F93;&#x5165;</li>
<li>&#x8F93;&#x51FA;&#xFF1A;&#x81F3;&#x5C11;&#x4E00;&#x4E2A;&#x8F93;&#x51FA;</li>
<li>&#x6709;&#x7A77;&#x6027;&#xFF1A;&#x603B;&#x80FD;&#x5728;&#x6709;&#x9650;&#x6B65;&#x540E;&#x7EC8;&#x6B62;&#xFF0C;&#x4E14;&#x6BCF;&#x6B65;&#x5728;&#x53EF;&#x63A5;&#x53D7;&#x65F6;&#x95F4;&#x5185;&#x5B8C;&#x6210;</li>
<li>&#x786E;&#x5B9A;&#x6027;&#xFF1A;&#x6BCF;&#x4E00;&#x6B65;&#x6709;&#x786E;&#x5B9A;&#x7684;&#x542B;&#x4E49;&#xFF0C;&#x65E0;&#x4E8C;&#x4E49;&#x6027;</li>
<li>&#x53EF;&#x884C;&#x6027;&#xFF1A;&#x6BCF;&#x4E00;&#x6B65;&#x90FD;&#x53EF;&#x884C;</li>
</ul>
<h3 id="&#x7B97;&#x6CD5;&#x8BBE;&#x8BA1;&#x7684;&#x8981;&#x6C42;">&#x7B97;&#x6CD5;&#x8BBE;&#x8BA1;&#x7684;&#x8981;&#x6C42;</h3>
<ul>
<li>&#x6B63;&#x786E;&#x6027;&#xFF1A;&#x6CA1;&#x6709;&#x8BED;&#x6CD5;&#x9519;&#x8BEF;&#xFF0C;&#x53CD;&#x6620;&#x95EE;&#x9898;&#x9700;&#x6C42;&#xFF0C;&#x80FD;&#x5F97;&#x5230;&#x6B63;&#x786E;&#x7B54;&#x6848;&#xFF0C;&#x975E;&#x6CD5;&#x8F93;&#x5165;&#x4E5F;&#x6709;&#x8BF4;&#x660E;</li>
<li>&#x53EF;&#x8BFB;&#x6027;&#xFF1A;&#x4FBF;&#x4E8E;&#x9605;&#x8BFB;&#x3001;&#x7406;&#x89E3;&#x548C;&#x4EA4;&#x6D41;</li>
<li>&#x5065;&#x58EE;&#x6027;&#xFF1A;&#x8F93;&#x5165;&#x6570;&#x636E;&#x4E0D;&#x5408;&#x6CD5;&#x65F6;&#x4E5F;&#x4E5F;&#x80FD;&#x505A;&#x51FA;&#x76F8;&#x5173;&#x5904;&#x7406;&#xFF0C;&#x800C;&#x4E0D;&#x662F;&#x4EA7;&#x751F;&#x5F02;&#x5E38;&#x6216;&#x83AB;&#x540D;&#x5176;&#x5999;&#x7684;&#x7ED3;&#x679C;</li>
</ul>
<h3 id="&#x7B97;&#x6CD5;&#x6548;&#x7387;&#x7684;&#x5EA6;&#x91CF;&#x65B9;&#x6CD5;">&#x7B97;&#x6CD5;&#x6548;&#x7387;&#x7684;&#x5EA6;&#x91CF;&#x65B9;&#x6CD5;</h3>
<ul>
<li>&#x4E8B;&#x540E;&#x7EDF;&#x8BA1;&#x65B9;&#x6CD5;&#xFF1A;&#x901A;&#x8FC7;&#x8BBE;&#x8BA1;&#x597D;&#x7684;&#x6D4B;&#x8BD5;&#x7A0B;&#x5E8F;&#x548C;&#x6570;&#x636E;&#xFF0C;&#x6BD4;&#x8F83;&#x8FD0;&#x884C;&#x65F6;&#x95F4;<ul>
<li>&#x7F3A;&#x9677;<ol>
<li>&#x9700;&#x8981;&#x7F16;&#x5199;&#x6D4B;&#x8BD5;&#x7A0B;&#x5E8F;&#xFF0C;&#x8D39;&#x65F6;&#x8D39;&#x529B;</li>
<li>&#x53D7;&#x73AF;&#x5883;&#x56E0;&#x7D20;&#x5F71;&#x54CD;&#xFF0C;&#x673A;&#x5668;&#x8FD0;&#x884C;&#x65F6;&#x73AF;&#x5883;&#x96BE;&#x4EE5;&#x4FDD;&#x5B58;&#x76F8;&#x540C;</li>
<li>&#x7B97;&#x6CD5;&#x6D4B;&#x8BD5;&#x6570;&#x636E;&#x8BBE;&#x8BA1;&#x56F0;&#x96BE;</li>
</ol>
</li>
</ul>
</li>
<li>&#x4E8B;&#x524D;&#x5206;&#x6790;&#x4F30;&#x7B97;&#x65B9;&#x6CD5;&#xFF1A;&#x7A0B;&#x5E8F;&#x7F16;&#x5236;&#x524D;&#xFF0C;&#x4F9D;&#x636E;&#x7EDF;&#x8BA1;&#x65B9;&#x6CD5;&#x5BF9;&#x7B97;&#x6CD5;&#x8FDB;&#x884C;&#x4F30;&#x7B97;</li>
</ul>
<blockquote>
<p>&#x7B97;&#x6CD5;&#x8FD0;&#x884C;&#x65F6;&#x95F4;&#x53D6;&#x51B3;&#x4E8E;</p>
</blockquote>
<ol>
<li>&#x7B97;&#x6CD5;&#x91C7;&#x7528;&#x7684;&#x7B56;&#x7565;&#xFF0C;&#x65B9;&#x6CD5;   :arrow_right:  &#x7B97;&#x6CD5;&#x597D;&#x574F;&#x7684;&#x6839;&#x672C;</li>
<li>&#x7F16;&#x8BD1;&#x4EA7;&#x751F;&#x7684;&#x4EE3;&#x7801;&#x8D28;&#x91CF;&#x200B; &#x200B; :arrow_right:  &#x9700;&#x8981;&#x8F6F;&#x4EF6;&#x6765;&#x652F;&#x6301;</li>
<li>&#x95EE;&#x9898;&#x7684;&#x8F93;&#x5165;&#x89C4;&#x6A21;</li>
<li>&#x673A;&#x5668;&#x6267;&#x884C;&#x6307;&#x4EE4;&#x7684;&#x901F;&#x5EA6;&#x200B; &#x200B; :arrow_right:  &#x770B;&#x786C;&#x4EF6;&#x6027;&#x80FD;</li>
</ol>
<blockquote>
<p>&#x4E00;&#x4E2A;&#x7A0B;&#x5E8F;&#x7684;&#x8FD0;&#x884C;&#x65F6;&#x95F4;&#xFF0C;&#x4F9D;&#x8D56;&#x4E8E;&#x7B97;&#x6CD5;&#x7684;&#x597D;&#x574F;&#x548C;&#x95EE;&#x9898;&#x7684;&#x8F93;&#x5165;&#x89C4;&#x6A21;&#x3002;</p>
<p>&#x95EE;&#x9898;&#x7684;&#x8F93;&#x5165;&#x89C4;&#x6A21;&#x5373;&#x8F93;&#x5165;&#x91CF;&#x7684;&#x591A;&#x5C11;</p>
</blockquote>
<h3 id="&#x51FD;&#x6570;&#x7684;&#x6E10;&#x8FDB;&#x589E;&#x957F;">&#x51FD;&#x6570;&#x7684;&#x6E10;&#x8FDB;&#x589E;&#x957F;</h3>
<blockquote>
<p>&#x7ED9;&#x5B9A;&#x4E24;&#x4E2A;&#x51FD;&#x6570;f(n)&#x548C;g(n)&#xFF0C;&#x5982;&#x679C;&#x5B58;&#x5728;&#x4E00;&#x4E2A;&#x6574;&#x6570;N&#xFF0C;&#x4F7F;&#x5F97;&#x5BF9;&#x4E8E;&#x6240;&#x6709;&#x7684;n &gt; N&#xFF0C;f(n)&#x603B;&#x662F;&#x6BD4;g(n)&#x5927;&#xFF0C;&#x90A3;&#x4E48;f(n)&#x7684;&#x6E10;&#x8FDB;&#x589E;&#x957F;&#x5FEB;&#x4E8E;g(n)</p>
</blockquote>
<p>&#x5047;&#x8BBE;&#x7B97;&#x6CD5;A&#x548C;B&#x7684;&#x8F93;&#x5165;&#x89C4;&#x6A21;&#x76F8;&#x540C;&#xFF0C;A&#x8981;&#x505A;2n+3&#x6B21;&#x64CD;&#x4F5C;&#xFF0C;B&#x8981;&#x8FDB;&#x884C;3n+1&#x6B21;&#x64CD;&#x4F5C;</p>
<table>
<thead>
<tr>
<th style="text-align:center">&#x6B21;&#x6570;</th>
<th style="text-align:center">&#x7B97;&#x6CD5;A(2n+3)</th>
<th style="text-align:center">&#x7B97;&#x6CD5;A&apos;(2n)</th>
<th style="text-align:center">&#x7B97;&#x6CD5;B(3n+1)</th>
<th style="text-align:center">&#x7B97;&#x6CD5;B&apos;(3n)</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">n=1</td>
<td style="text-align:center">5</td>
<td style="text-align:center">2</td>
<td style="text-align:center">4</td>
<td style="text-align:center">3</td>
</tr>
<tr>
<td style="text-align:center">n=2</td>
<td style="text-align:center">7</td>
<td style="text-align:center">4</td>
<td style="text-align:center">7</td>
<td style="text-align:center">6</td>
</tr>
<tr>
<td style="text-align:center">n=3</td>
<td style="text-align:center">9</td>
<td style="text-align:center">6</td>
<td style="text-align:center">10</td>
<td style="text-align:center">9</td>
</tr>
<tr>
<td style="text-align:center">n=10</td>
<td style="text-align:center">23</td>
<td style="text-align:center">20</td>
<td style="text-align:center">31</td>
<td style="text-align:center">30</td>
</tr>
<tr>
<td style="text-align:center">n=100</td>
<td style="text-align:center">203</td>
<td style="text-align:center">200</td>
<td style="text-align:center">301</td>
<td style="text-align:center">300</td>
</tr>
</tbody>
</table>
<p>n=1&#x65F6;&#xFF0C;&#x7B97;&#x6CD5;A&#x4E0D;&#x5982;&#x7B97;&#x6CD5;B&#xFF0C;n&gt;2&#x65F6;&#xFF0C;&#x7B97;&#x6CD5;A&#x5C31;&#x5F00;&#x59CB;&#x4F18;&#x4E8E;&#x7B97;&#x6CD5;B&#x4E86;</p>
<p><strong>&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x5FFD;&#x7565;&#x52A0;&#x6CD5;&#x5E38;&#x6570;</strong></p>
<p>&#x540C;&#x7406;</p>
<p><strong>&#x6700;&#x9AD8;&#x6B21;&#x9879;&#x76F8;&#x4E58;&#x7684;&#x5E38;&#x6570;&#x5E76;&#x4E0D;&#x91CD;&#x8981;</strong></p>
<p><strong>&#x6700;&#x9AD8;&#x6B21;&#x9879;&#x7684;&#x6307;&#x6570;&#x5927;&#x7684;&#xFF0C;&#x51FD;&#x6570;&#x968F;&#x7740;n&#x7684;&#x589E;&#x957F;&#xFF0C;&#x7ED3;&#x679C;&#x4E5F;&#x4F1A;&#x53D8;&#x5F97;&#x589E;&#x957F;&#x7279;&#x522B;&#x5FEB;</strong></p>
<p>&#x5224;&#x65AD;&#x7B97;&#x6CD5;&#x7684;&#x6548;&#x7387;&#x65F6;&#xFF0C;&#x66F4;&#x5E94;&#x8BE5;&#x5173;&#x6CE8;&#x6700;&#x9AD8;&#x9636;&#x9879;&#x7684;&#x9636;&#x6570;</p>
<h3 id="&#x7B97;&#x6CD5;&#x7684;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;">&#x7B97;&#x6CD5;&#x7684;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;</h3>
<h4 id="&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#x5B9A;&#x4E49;">&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#x5B9A;&#x4E49;</h4>
<blockquote>
<p>&#x8BED;&#x53E5;&#x6267;&#x884C;&#x6B21;&#x6570;T(n)&#x662F;&#x5173;&#x4E8E;&#x95EE;&#x9898;&#x89C4;&#x6A21;n&#x7684;&#x51FD;&#x6570;&#x3002;&#x7B97;&#x6CD5;&#x7684;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;&#x8BB0;&#x4F5C;&#xFF1A;T(n)=O(f(n))</p>
<p>&#x5B83;&#x8868;&#x793A;&#x968F;&#x95EE;&#x9898;&#x89C4;&#x6A21;&#x7684;&#x589E;&#x5927;&#xFF0C;&#x7B97;&#x6CD5;&#x6267;&#x884C;&#x65F6;&#x95F4;&#x7684;&#x589E;&#x957F;&#x7387;&#x548C;f(n)&#x7684;&#x589E;&#x957F;&#x7387;&#x76F8;&#x540C;</p>
</blockquote>
<h4 id="&#x63A8;&#x5BFC;&#x5927;o&#x9636;&#x65B9;&#x6CD5;">&#x63A8;&#x5BFC;&#x5927;O&#x9636;&#x65B9;&#x6CD5;</h4>
<ol>
<li>&#x7528;&#x5E38;&#x6570;1&#x53D6;&#x4EE3;&#x8FD0;&#x884C;&#x65F6;&#x95F4;&#x4E2D;&#x7684;&#x6240;&#x6709;&#x52A0;&#x6CD5;&#x5E38;&#x6570;</li>
<li>&#x5728;&#x4FEE;&#x6539;&#x540E;&#x7684;&#x8FD0;&#x884C;&#x6B21;&#x6570;&#x51FD;&#x6570;&#x4E2D;&#xFF0C;&#x53EA;&#x4FDD;&#x7559;&#x6700;&#x9AD8;&#x9636;&#x9879;</li>
<li>&#x5982;&#x679C;&#x6700;&#x9AD8;&#x9636;&#x9879;&#x5B58;&#x5728;&#x4E14;&#x4E0D;&#x662F;1&#xFF0C;&#x53BB;&#x9664;&#x4E0E;&#x8FD9;&#x4E2A;&#x9879;&#x76F8;&#x4E58;&#x7684;&#x5E38;&#x6570;</li>
</ol>
<p>&#x5F97;&#x5230;&#x7684;&#x7ED3;&#x679C;&#x5C31;&#x662F;&#x5927;O&#x9636;</p>
<h4 id="&#x5E38;&#x89C1;&#x7684;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;">&#x5E38;&#x89C1;&#x7684;&#x65F6;&#x95F4;&#x590D;&#x6742;&#x5EA6;</h4>
<p>$$
O(1)&lt;O(logn)&lt;O(n)&lt;O(nlogn)&lt;O(n^2)&lt;O(n^3)&lt;O(2^n)&lt;O(n!)&lt;O(n^n)</p>
<p>$$</p>
<h4 id="&#x6700;&#x574F;&#x60C5;&#x51B5;&#x548C;&#x8BC4;&#x4EF7;&#x60C5;&#x51B5;">&#x6700;&#x574F;&#x60C5;&#x51B5;&#x548C;&#x8BC4;&#x4EF7;&#x60C5;&#x51B5;</h4>
<blockquote>
<p>&#x5E73;&#x5747;&#x8FD0;&#x884C;&#x65F6;&#x95F4;&#x662F;&#x6240;&#x6709;&#x60C5;&#x51B5;&#x4E2D;&#x6700;&#x6709;&#x610F;&#x4E49;&#x7684;</p>
<p>&#x4E00;&#x822C;&#x6CA1;&#x6709;&#x7279;&#x6B8A;&#x8BF4;&#x660E;&#xFF0C;&#x90FD;&#x6307;&#x6700;&#x574F;&#x590D;&#x6742;&#x5EA6;</p>
</blockquote>
<h4 id="&#x7B97;&#x6CD5;&#x7A7A;&#x95F4;&#x590D;&#x6742;&#x5EA6;">&#x7B97;&#x6CD5;&#x7A7A;&#x95F4;&#x590D;&#x6742;&#x5EA6;</h4>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="大话数据结构笔记1.html" class="navigation navigation-prev " aria-label="Previous page: 大话数据结构笔记1">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../面试笔试/" class="navigation navigation-next " aria-label="Next page: 面试笔试">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"大话数据结构笔记2","level":"1.12.2","depth":2,"next":{"title":"面试笔试","level":"1.13","depth":1,"path":"面试笔试/README.md","ref":"面试笔试/README.md","articles":[{"title":"字节跳动5月11日笔试","level":"1.13.1","depth":2,"path":"面试笔试/字节跳动5月11日笔试.md","ref":"面试笔试/字节跳动5月11日笔试.md","articles":[]},{"title":"阿里3月23日笔试","level":"1.13.2","depth":2,"path":"面试笔试/阿里3月23日笔试.md","ref":"面试笔试/阿里3月23日笔试.md","articles":[]},{"title":"面试突击","level":"1.13.3","depth":2,"path":"面试笔试/面试突击.md","ref":"面试笔试/面试突击.md","articles":[]}]},"previous":{"title":"大话数据结构笔记1","level":"1.12.1","depth":2,"path":"数据结构知识/大话数据结构笔记1.md","ref":"数据结构知识/大话数据结构笔记1.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-search","-lunr","-sharing","-anchor-navigation-ex","todo","code","-katex","github","-summary","search-pro","chapter-fold","theme-comscore","toggle-chapters","flexible-alerts"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"chapter-fold":{},"github":{"url":"https://github.com/BluePrintYang"},"todo":{},"search-pro":{},"code":{"copyButtons":true},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"anchor-navigation-ex":{"showLevel":false,"showGoTop":true,"isRewritePageTitle":true,"isShowTocTitleIcon":true,"tocLevel1Icon":"fa fa-hand-o-right","tocLevel2Icon":"fa fa-hand-o-right","tocLevel3Icon":"fa fa-hand-o-right"},"theme-comscore":{},"flexible-alerts":{"danger":{"className":"danger","icon":"fa fa-ban","label":"Attention"},"note":{"className":"info","icon":"fa fa-info-circle","label":"Note"},"style":"callout","tip":{"className":"tip","icon":"fa fa-lightbulb-o","label":"Tip"},"warning":{"className":"warning","icon":"fa fa-exclamation-triangle","label":"Warning"}},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"toggle-chapters":{}},"theme":"default","author":"yanglonglong","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"My Study Note","language":"zh-hans","links":{"sidebar":{"My Blog":"https://www.yangllong.top/"}},"gitbook":"*"},"file":{"path":"数据结构知识/大话数据结构笔记2.md","mtime":"2020-06-29T16:04:36.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-01-14T07:15:50.272Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-toggle-chapters/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-flexible-alerts/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-theme-comscore/test.js"></script>
        
    

    </body>
</html>

